<?php
///**
// * Created by PhpStorm.
// * User: Administrator
// * Date: 2018/8/15
// * Time: 9:54
// */
////echo 'Your name is :'.$_POST["name"]."<br />";
////echo 'Your password is :'.$_POST["password"]."<br />";
//
//include 'user.php';
//$sql = "SELECT name, password FROM user";
////$insets = "INSERT INTO user(name,password)VALUE ('啊按时发生发生实','1')";
//$result = $con->query($sql);
//while($row = mysqli_fetch_array($result)){
//    echo $row['name']." ".$row['password']."<br />";
//}
////$result1 = $con->query($insets);
//$name = $password = "";
//if ($_SERVER["REQUEST_METHOD"] == "POST") {
//    $name = test_input($_POST["name"]);
//    while ($row = mysqli_fetch_array($result)){
//        //echo $row['name']." ".$row['password']."<br />";
//        if($name == $row['name']){
//            echo "该用户已存在";
//        }
//    }
//    $password = test_input($_POST["password"]);
//    $con->query("INSERT INTO user(name,password)VALUE ($name,$password)");
//   // $name = test_input($_POST["name"]);
//    //$password = test_input($_POST["password"]);
//}
//function test_input($data)
//{
//    $data = trim($data);
//    $data = stripslashes($data);
//    $data = htmlspecialchars($data);
//    return $data;
//}
//echo 'Your name is :'.$name."<br />";
//echo 'Your password is :'.$password."<br />";



//$input = "Hello,PHP World!";
//$input = "Hello,PHP World!";

















//$sql = "SELECT * FROM user";
//$insets = "INSERT INTO user(id,name,password,sex,avatar,slogan,login_time,add_time,update_time)VALUE ('6','啊按时发生发生实','1','sdsa','签名2','3','2','5446','4645')";
//$updates = "UPDATE user SET name='王五'WHERE id=2";
//$deletes = "DELETE FROM user WHERE id=1";
//$paix = "SELECT * FROM user ORDER BY id DESC ";
//$result = $con->query($sql);
//if(!$result){
//    echo $con->error;
//}else{
//    echo '查询成功'."<br />";
//}
//while($row = mysqli_fetch_array($result)){
//    echo $row['id']." ".$row['name']." ".$row['password']." ".$row['sex']." ".$row['avatar']." ".$row['slogan']." ".$row['login_time']." ".$row['add_time']." ".$row['update_time']."<br />";
//}
////插入数据
////$result1 = $con->query($insets);
////if(!$result1){
////    echo $con->error;
////}else{
////    echo '插入成功'."<br />";
////}
//
////修改数据
////$result2 = $con->query($updates);
////if(!$result2){
////    echo $con->error;
////}else{
////    echo '修改成功'."<br />";
////}
////mysqli_close($con);
//
////删除数据
////$result3 = $con->query($deletes);
////if(!$result3){
////    echo $con->error;
////}else{
////    echo '删除成功'."<br />";
////}
//
////排序
//$result4 = $con->query($paix);
//if(!$result4){
//    echo $con->error;
//}else{
//    echo '排序成功'."<br />";
//}
//while($row = mysqli_fetch_array($result4)){
//    echo $row['id']." ".$row['name']." ".$row['password']." ".$row['sex']." ".$row['avatar']." ".$row['slogan']." ".$row['login_time']." ".$row['add_time']." ".$row['update_time']."<br />";
//}
////$result4 = mysqli_query($con,$paix);
////if(!$result4){
////    echo $con->error;
////}else{
////    echo '查询成功'."<br />";
////}
////while($row = mysqli_fetch_array($result4)){
////    echo $row['id']." ".$row['name']." ".$row['password']." ".$row['sex']." ".$row['avatar']." ".$row['slogan']." ".$row['login_time']." ".$row['add_time']." ".$row['update_time']."<br />";
////}
//mysqli_close($con);



